Method and system for compensating image having fixed pattern noise

ABSTRACT

A method and a system for compensating an image having fixed pattern noise are provided. The method is adapted to a 4-cell sensor and can automatically calculate appropriate compensation parameters for fixed pattern noise according to non-uniformity of the sensor and lens. Since the defects in the sensor or the lens may cause non-uniform fixed pattern noise, an image is firstly divided into multiple grids and a pixel average of every channel in the grids is calculated. Afterwards, a fixed pattern noise compensation coefficient of every pixel can be calculated according to characteristics of the image formed by the 4-cell sensor. In one aspect, the compensation coefficient of the current pixel can be calculated by extrapolation or interpolation. The fixed pattern noise in the image can be corrected.

CROSS-REFERENCE TO RELATED PATENT APPLICATION

This application claims the benefit of priority to Taiwan PatentApplication No. 109127426, filed on Aug. 12, 2020. The entire content ofthe above identified application is incorporated herein by reference.

Some references, which may include patents, patent applications andvarious publications, may be cited and discussed in the description ofthis disclosure. The citation and/or discussion of such references isprovided merely to clarify the description of the present disclosure andis not an admission that any such reference is “prior art” to thedisclosure described herein. All references cited and discussed in thisspecification are incorporated herein by reference in their entiretiesand to the same extent as if each reference was individuallyincorporated by reference.

FIELD OF THE DISCLOSURE

The disclosure is generally related to an image compensation technology,and more particularly to a method for compensating an image formed by animage sensor that produces fixed pattern noise and a system thereof.

BACKGROUND OF THE DISCLOSURE

One of the reasons that a fixed pattern noise (FPN) occurs in an imageis that a noise with higher brightness than a background may easilyoccur to a specific position of pixels under long exposure. Withphotography as an example, various noises with different brightness thanthe background may occur at a fixed position in a photo, even if thephoto is taken at different scenes. The noises may be classified intotwo types: dark signal non-uniformity (DSNU) and photo responsenon-uniformity (PRNU). The DSNU indicates a fixed pattern noise that isdetected when the lens is covered. The PRNU indicates a fixed patternnoise that is produced due to a pixel having inconsistent responses tothe lights.

The noise can be expressed by a formula of:P_(read)=gain×P_(real)+offset. “P_(read)” represents a pixel valuesensed by an image sensor, “gain” represents the noise caused by photoresponse non-uniformity, and “offset” represents the noise caused bydark signal non-uniformity. The formula indicates that the fixed patternnoise appearing in a dark environment can be compensated by calculatingan offset, and the fixed pattern noise appearing under a normal lightcan be corrected by calculating a gain.

However, the fixed pattern noise may have problems of non-uniformity.For example, when a lens and an image sensor of an image retrievingdevice has poor quality, the fixed pattern noise may be non-uniform,such as left-right non-uniformity or up-down non-uniformity. Further,both left-right non-uniformity and up-down non-uniformity may occur atthe same time when the lens and the image sensor of the image retrievingdevice are of poor quality.

A conventional fixed pattern noise correction (FPNC) is provided. FPNCis a grid-based image compensation technology that is used to correctthe fixed pattern noise by regions of the image. Nevertheless, when theimage meets up-to-down non-uniformity, some of the fixed pattern noisemay still remain on the image.

SUMMARY OF THE DISCLOSURE

The present disclosure is related to a method for compensating an imagehaving fixed pattern noise and a system implementing the method. Themethod can be performed by a software program or hardware in a specificsystem. With an image sensor as an example, an image is formed when alight is received via a lens and processed by the image sensor. Aprocessing circuit in the system performs the method for compensatingthe image having fixed pattern noise.

The method for compensating an image having fixed pattern noise isadapted to a 4-cell sensor that implements an image sensor for everypixel channel by using a 4-cell group. In the method, the appropriatecompensation parameters for fixed pattern noise can be calculatedautomatically based on the non-uniformity of the image sensor and lens.

In one embodiment of the disclosure, in the main process of the methodfor compensating image having fixed pattern noise, an image is dividedinto multiple grids in an array, in which each of the grids includesmultiple 4-cell groups, each of the 4-cell groups includes 4 cells, andeach cell includes 4 pixels. Afterwards, a pixel average for everychannel of each of the grids is calculated, and a pixel average forevery pixel in each of the 4-cell groups is also calculated. Further, afixed pattern noise compensation coefficient for every pixel of theimage can be calculated according to a ratio of the pixel average ofevery channel in each grid and the pixel average of the pixels in eachgrid. The fixed pattern noise compensation coefficient for every pixelis multiplied by a pixel value of every pixel so as to complete thefixed pattern noise compensation.

Preferably, the 4 cells of every 4-cell group records the values of agreen channel (Gr), a red channel (R) and a green channel (Gb) that aregenerated by a 4-cell sensor through a quad Bayer array filter.

Further, in an exemplary example of the disclosure, the 4-cell of every4-cell group include 16 pixels. The positions of the pixels can berepresented by position indexes. The above-mentioned pixel average ofevery channel in each of the grids is an average that is calculatedbased on a summation of the pixel values of the pixels with the sameposition indexes. The pixel average of every channel is a channelaverage.

In an aspect of the disclosure, the pixel value of a current pixel ismultiplied by the fixed pattern noise compensation coefficient of thecurrent pixel so as to compensate a fixed pattern noise of the image.Further, when facing various intensities of different light sources, anadjustment parameter is introduced to adjust strength of the fixedpattern noise compensation coefficient. The pixel value that is adjustedand that has undergone fixed pattern noise compensation is thenobtained.

Further, when the fixed pattern noise compensation is completed, afurther step is performed to detect a stripe pattern caused bydifferences between the pixel values of a green pixel and other greenpixels in the up and down directions or left and right directions of thegreen pixel. A process of self-adaptive compensation is then performed.

Still further, extrapolation can be used to optimize the fixed patternnoise compensation coefficient for edge pixels in the image. Forextrapolation, one row and one column can be added outside an edge ofthe image with multiple grids in an array form, and the fixed patternnoise compensation coefficient for the edge pixels can be obtained by anextrapolation operation.

Further, in one embodiment of the disclosure, interpolation is then usedto calculate the fixed pattern noise compensation coefficient for thecurrent pixel. In the interpolation, a plurality of grids adjacent tothe current pixel are firstly determined, and then distances between thecenters of the plurality of grids and the current pixel are calculated.The fixed pattern noise compensation coefficient for the current pixelcan be obtained by an interpolation operation according to thedistances.

These and other aspects of the present disclosure will become apparentfrom the following description of the embodiment taken in conjunctionwith the following drawings and their captions, although variations andmodifications therein may be affected without departing from the spiritand scope of the novel concepts of the disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

The present disclosure will become more fully understood from thefollowing detailed description and accompanying drawings.

FIG. 1 is a schematic diagram depicting image grids obtained by dividingan image;

FIG. 2 is a schematic diagram depicting red, green and blue pixels shownby multiple 4-cells in one embodiment of the disclosure;

FIG. 3 is a schematic diagram depicting multiple 4-cell groups in a gridin one embodiment of the disclosure;

FIG. 4 shows a flow chart describing a method for compensating an imagehaving fixed pattern noise according to one embodiment of thedisclosure;

FIG. 5 is a schematic diagram depicting calculation of compensationcoefficient for edge pixels in the method for compensating the imagehaving fixed pattern noise according to one embodiment of thedisclosure;

FIG. 6 is a schematic diagram depicting determination of the adjacentgrids of a current pixel in the method for compensating an image havingfixed pattern noise according to one embodiment of the disclosure;

FIG. 7A and FIG. 7B show schematic diagrams depicting pixels in verticaland horizontal directions of the current pixel in one embodiment of thedisclosure;

FIG. 8A and FIG. 8B are schematic diagrams depicting pixels that areused to correct stripe patterns in the image in one embodiment of thedisclosure;

FIG. 9 shows a flow chart describing the process for self-adaptivecompensation with respect to the green pixel according to one embodimentof the disclosure; and

FIG. 10 shows a framework of a system for performing the method forcompensating an image having fixed pattern noise according to oneembodiment of the disclosure.

DETAILED DESCRIPTION OF THE EXEMPLARY EMBODIMENTS

The present disclosure is more particularly described in the followingexamples that are intended as illustrative only since numerousmodifications and variations therein will be apparent to those skilledin the art. Like numbers in the drawings indicate like componentsthroughout the views. As used in the description herein and throughoutthe claims that follow, unless the context clearly dictates otherwise,the meaning of “a”, “an”, and “the” includes plural reference, and themeaning of “in” includes “in” and “on”. Titles or subtitles can be usedherein for the convenience of a reader, which shall have no influence onthe scope of the present disclosure.

The terms used herein generally have their ordinary meanings in the art.In the case of conflict, the present document, including any definitionsgiven herein, will prevail. The same thing can be expressed in more thanone way. Alternative language and synonyms can be used for any term(s)discussed herein, and no special significance is to be placed uponwhether a term is elaborated or discussed herein. A recital of one ormore synonyms does not exclude the use of other synonyms. The use ofexamples anywhere in this specification including examples of any termsis illustrative only, and in no way limits the scope and meaning of thepresent disclosure or of any exemplified term. Likewise, the presentdisclosure is not limited to various embodiments given herein. Numberingterms such as “first”, “second” or “third” can be used to describevarious components, signals or the like, which are for distinguishingone component/signal from another one only, and are not intended to, norshould be construed to impose any substantive limitations on thecomponents, signals or the like.

Fixed pattern noise (FPN) often occurs to an image that is formed by animage sensor. One of the reasons that the noise occurs is that somepositions of pixels of the image being generated by a digital imagingsensor have higher brightness noises relative to the background. Ingeneral, the noises form the fixed pattern noise due to the lens or theimage sensor being defective.

The disclosure is related to a method for compensating an image havingfixed pattern noise and a system thereof. The method is adapted to animage sensor that forms the fixed pattern noise so as to achieve fixedpattern noise correction (FPNC). The process in the method is mainly toobtain a set of appropriate fixed pattern noise compensationcoefficients that are used to perform fixed pattern noise compensation.

The method for compensating an image having fixed pattern noise isadapted to compensating an image generated by an image sensor. Themethod can be a grid-based fixed pattern noise compensation method thatcan compensate the image regionally. The method is generally used tosolve the non-uniform fixed pattern noise issue in the image.

In the method for compensating an image having fixed pattern noise, auniform image is provided, and the image is divided into “m×n” grids.Reference is made to FIG. 1, which is a schematic diagram depicting animage 10 being divided into multiple grids. In the present example, theheight of the image 10 is divided into “m” segments and the width of theimage 10 is divided into “n” segments, so as to form the image 10 with“m×n” grids 30. The size of each of the grids 30 is “p×q.”

Every grid 30 is consisted of multiple 4-cell groups. 4-cell groupcomplies with a format specified to a 4-cell sensor that is adapted tothe method for compensating an image having fixed pattern noise. In oneof the embodiments, the 4-cell sensor forms an image that is depicted byred, green and blue pixels, i.e., 4 cells, as shown in FIG. 2, via aquad Bayer array. In the present example, a 4-cell group 20 includes afirst 4-cell 201, a second 4-cell 202, a third 4-cell 203 and a fourth4-cell 204. The pixel is the smallest unit to describe an entire image.In FIG. 2, the numbers 0 to 15 represent position indexes representingpositions of the pixels.

In the present example, every 4-cell group 20 is consisted of 4 pixelsthat can be composed of red, green and blue pixels. A first 4-cell 201is a green pixel (Gr), a second 4-cell 202 is a red pixel (R), a third4-cell 203 is a blue pixel (B), and a fourth 4-cell 204 is a green pixel(Gb). The first 4-cell 201 (Gr) is the green pixel adjacent to thesecond 4-cell 202 (R). The fourth 4-cell 204 (Gb) is the other greenpixel adjacent to the third 4-cell 203 (B).

FIG. 3 is a schematic diagram depicting that the image 10 is dividedinto multiple grids 30, and every grid 30 is consisted of multiple4-cell groups, such as the 4-cell group 20 schematically shown in FIG.2. The present example shows that the grid 30 is consisted of four4-cell groups, i.e., a first 4-cell group 301, a second 4-cell group302, a third 4-cell group 303 and a fourth 4-cell group 304.

The 4-cell groups 301, 302, 303 or 304 can be indicated by the pixelswith the position indexes 0 to 15. According to one embodiment of themethod for compensating an image having fixed pattern noise, the image10 is divided into multiple grids, and each of the grids can bedescribed by an average (localAvg) of a summation of the pixel values ofthe pixels with the same position indexes in the grid. Therefore, acompensation coefficient for each of the grids can be obtained.

The method can be implemented in a system via a software program, afirmware or a circuit. Reference is made to FIG. 10, in which a system100 particularly includes an image sensor 103 and other components. Thesystem 100 is such as a camera including a lens 101, the image sensor103, a memory 105 and a processing circuit 107. The system 100 processesthe image data generated by the image sensor 103 via software orfirmware. For example, a software program can be used to operate themethod for compensating an image having fixed pattern noise, oralternatively, the firmware operated in the processing circuit 107 canalso be used to perform the method.

In the method for image compensation, a compensation coefficient can becorrected to an appropriate value firstly. The corrected compensationcoefficient is used to compensate the fixed pattern noise (FPN) occurswhen the image sensor generates the image. In particular, the method isa grid-based compensation method that can regionally compensate thefixed pattern noise. FIGS. 1, 2 and 3 show the preliminary griddingoperations for the image, and the method thereof can be referred to asin FIG. 4.

When an image such as a uniform image under a normal light source isreceived, the image can be divided into rectangular grids in an array,e.g., “m×n” grids. Referring to grid 30 shown in FIG. 1, the grid 30includes multiple 4-cell groups, as shown in FIG. 3. Every cell includesfour pixels, Gr, Gb, R and B, so that a 4-cell includes 16 pixels. Asshown in FIG. 2, the position of the pixel can be represented by theposition index (0-15) (step S401). With a 4-cell sensor adopted in themethod as an example, the 4 cells of the 4-cell group respectivelyrecord red (R), blue (B) and green channel (Gr, Gb) values generated bya 4-cell sensor through a quad Bayer array filter. When receiving thepixel values of the red, green and blue channels of the image, a pixelaverage of pixels in each of the channels (i.e., channel average) inevery grid can be calculated. According to one of the embodiments, anaverage (localAvg) is calculated from a summation of the pixel values atthe same position index in the grid. The channel averages for thechannels in the grid can be represented by BGridAvg(i,j), RGridAvg(i,j),GbGridAvg(i,j) and GrGridAvg(i,j) that are the averages of blue channel,red channel, Gb channel and Gr channel respectively (step S403).Further, a pixel average (localAvg(i,j,k)) of pixels in every 4-cellgroup can also calculated, and in one embodiment the pixel average canrepresent the pixel value respective to the channel (step S405). In theabove functions, “(i, j)” represents the position of each of the gridsin the “m×n” array, and relationships of the variables thereof are“1<=i<=m” and “1<=j<=n.” For example, “BGridAvg(i,j)” represents theblue channel value of the grid in row i and column j, “RGridAvg(i,j)”represents the red channel value of the grid in row i and column j,“GbGridAvg(i,j)” represents the green channel value (Gb) of the grid inrow i and column j, and “GrGridAvg(i,j)” represents the other greenchannel value (Gr) of the grid in row i and column j. Furthermore, “k”represents the position of every pixel in the 4-cell group and “k” issuch as the 0 to 15 position indexes mentioned above.

The fixed pattern noise can be depicted by the equation:“P_(read)=gain×P_(real)+offset”, in which “P_(read)” represents a pixelvalue sensed by the image sensor, “offset” represents the dark signalnon-uniformity (DSNU) or photo response non-uniformity (PRNU). The fixedpattern noise appeared under a normal light source is obtained bycalculating a gain, i.e., the fixed pattern noise compensationcoefficient of the method, for the purpose of correction.

According to the image information such as “BGridAvg(i,j),RGridAvg(i,j), GbGridAvg(i,j), GrGridAvg(i,j) and localAvg(i,j,k)”obtained from the grids, the fixed pattern noise compensationcoefficients (COEF) for the pixels in the red, green and blue channelsare calculated (step S407). The fixed pattern noise compensationcoefficient (gain(i,j,k)) can be calculated by the equations as follows.

It should be noted that, as the embodiment shown in FIG. 2, the first4-cell 201 is the green pixel (Gr) and the position indexes (i.e., “k”)thereof are 0, 1, 4 and 5, the second 4-cell 202 is the red pixel (R)and the position indexes thereof are 2, 3, 6 and 7, the third 4-cell 203is the blue pixel (B) and the position indexes thereof are 8, 9, 12 and13, and the fourth 4-cell 204 is the green pixel (Gb) and the positionindexes thereof are 10, 11, 14 and 15.

The fixed pattern noise compensation coefficient (gain(i,j,k)) can becalculated by using equation 1. Equation 1 shows that the compensationcoefficient for every pixel in the grid is based on a ratio of thechannel average of each of the grids and the pixel average(localAvg(i,j,k)) of the pixels in every channel.

gain (i,j,0)=GrGridAvg (i,j)÷localAvg (i,j,0);

gain (i,j,1)=GrGridAvg (i,j)÷localAvg (i,j,1);

gain (i,j,2)=RGridAvg (i,j)÷localAvg (i,j,2);

gain (i,j,3)=RGridAvg (i,j)÷localAvg (i,j,3);

gain (i,j,4)=GrGridAvg (i,j)÷localAvg (i,j,4);

gain (i,j,5)=GrGridAvg (i,j)÷localAvg (i,j,5);

gain (i,j,6)=RGridAvg (i,j)÷localAvg (i,j,6);

gain(i,j,7)=RGridAvg(i,j)÷localAvg(i,j,7);

gain (i,j,8)=BGridAvg (i,j)÷localAvg (i,j,8);

gain (i,j,9)=BGridAvg (i,j)÷localAvg (i,j,9);

gain (i,j,10)=GbGridAvg (i,j)÷localAvg (i,j,10);

gain (i,j,11)=GbGridAvg (i,j)÷localAvg (i,j,11);

gain (i,j,12)=BGridAvg (i,j)÷localAvg (i,j,12);

gain (i,j,13)=BGridAvg (i,j)÷localAvg (i,j,13);

gain (i,j,14)=GbGridAvg (i,j)÷localAvg (i,j,14); and

gain (i,j,15)=GbGridAvg (i,j)÷localAvg (i,j,15)  Equation 1.

According to above equations, “gain(i,j,k)” indicates a fixed patternnoise compensation coefficient for each of pixels (positions “k”=0 to15) in a 4-cell group in every grid (i, j). An adjustment coefficientmay be added to the image that is to be compensated if necessary. In thecurrent step, the fixed pattern noise compensation coefficient for everycorrected pixel is multiplied by the pixel value of the pixel. The fixedpattern noise compensation coefficient for every pixel is used tocompensate an input image having fixed pattern noise.

Furthermore, for compensating the edge pixels in every grid that has asize of “p×q”, the corrected fixed pattern noise compensationcoefficient can be obtained in equation 1, and the fixed pattern noisecompensation coefficients (gain) for the edge pixels can be calculatedby extrapolation so as to optimize the compensation coefficients for theedge pixels (step S409). Reference is made to FIG. 5, and theabove-mentioned edge pixels in every grid can be specified to the pixelswhich are distanced from the upper and lower edges within p/2 and fromthe left and right edges within q/2.

For optimizing the compensation coefficients for the edge pixels, tworows and two columns are added outside the edges of each of the gridswhich are exemplarily “m×n” grids divided in an array form from anoriginal image. As the grids shown in FIG. 5, the grids of an image 50become “(m+2)×(n+2)” grids when the two rows and two columns are addedto the edges. The fixed pattern noise compensation coefficients for theedge pixels can be obtained by extrapolation, and the compensation canbe optimized accordingly. The fixed pattern noises for the edges andcorner pixels of the image can be obtained by calculating thegain(i,j,k), in which “k” represents position indexes of the pixels inthe 4-cell group. The fixed pattern noise compensation coefficient canbe calculated from equation 2.

Upper edge: gain(0,j,k)=2×gain(1,j,k)−gain(2,j,k), in which 1≤j≤n;

Lower edge: gain(m+1,j,k)=2×gain(m,j,k)−gain(m−1,j,k), wherein 1≤j≤n;

Left edge: gain(i,0,k)=2×gain(i,1,k)−gain(i,2,k), wherein 1≤i≤m;

Right edge: gain(i,n+1,k)=2×gain(i,n,k)−gain(i,n−1,k), wherein 1≤i≤m;

Upper-left: gain(0,0,k)=2×gain(1,1,k)−gain(2,2,k);

Upper-right: gain(0,n+1,k)=2×gain(1,n,k)−gain(2,n−1,k);

Lower-left: gain(m+1,k)=2×gain(m,1,k)−gain(m−1,2,k); and

Lower-right: gain(m+1,n+1,k)=2×gain(m,n,k)−gain(m−1,n−1,k);  Equation 2

where “m” is a height of an original grid of the image; “n” is a widthof the original grid of the image; “gain(i,j,k)” is the fixed patternnoise compensation coefficient of every pixel of the image; “(i,j)”indicates position of the grid when the rows and columns are newlyadded; and “k” indicates the position index of the cell.

The above steps describe that the fixed pattern noise compensationcoefficient for every pixel of the image is obtained and the correctedfixed pattern noise compensation coefficient is used to optimize thefixed pattern noise compensation coefficient for the edge pixels. Next,the corrected fixed pattern noise compensation coefficient is used toenhance the compensation for the pixel (step S411).

In the present step, when correcting the fixed pattern noise pixel bypixel, interpolation is incorporated to obtain the fixed pattern noisecompensation coefficient for the current pixel. In the interpolation,the grids adjacent to the current pixel are determined, generally, thereare plural adjacent grids. Reference is made to FIG. 6, which showscoordinates (x, y) of a current pixel 601. The current pixel 601 is in agrid and the adjacent grids thereof are represented by their centerpoints or central pixels. For example, the center points are such as acenter point 61(i1, j1) of the upper-left grid, a center point 62(i2,j2) of the upper-right grid, a center point 63(i3, j3) of thebottom-left grid, and a center point 64(i4, j4) of the bottom-right gridthat respectively represent the upper-left grid (i1=2, j1=3), theupper-right grid (i2=2, j2=4), the bottom-left grid (i3=3, j3=3) and thebottom-right grid (i4=3,j4=4).

The compensation coefficient for the current pixel 601 is also obtainedby interpolation. In the interpolation, distances between the currentpixel 601 and the center points 61, 62, 63 and 64 of the adjacent gridsof the current pixel 601 are calculated. The distances are such as adistance D1 between the current pixel 601 and the upper-right grid(i.e., the center point or a central pixel), a distance D2 between thecurrent pixel 601 and the bottom-right grid, a distance D3 between thecurrent pixel 601 and bottom-left grid, and a distance D4 between thecurrent pixel 601 and the bottom-right grid.

Thus, the interpolation is performed based on the distances D1, D2, D3and D4 and can be referred to as in equation 3 as follows. In equation3, the compensation coefficient for the current pixel can be obtainedthrough a bilinear interpolation.

gain_intp(k)=(D2/(D1+D2))×(D4/(D3+D4))×gain(i1,j1,k)+(D2/(D1+D2))×(D3/(D3+D4))×gain(i2,j2,k)+(D1/(D1+D2))×(D4/(D3+D4))×gain(i3,j3,k)+(D1/(D1+D2))×(D3/(D3+D4))×gain(i4,j4,k);  Equation3

where “gain_intp(k)” is the fixed pattern noise compensation coefficientfor the current pixel being obtained by interpolation, and“gain(i1,j1,k), gain(i2,j2,k), gain(i3,j3,k)” and “gain(i4,j4,k)” arethe fixed pattern noise compensation coefficients for central pixels ofthe grids adjacent to the current pixel.

When the interpolation is used to obtain the fixed pattern noisecompensation coefficient (gain_intp(k)) for the current pixel, thecompensation coefficient is incorporated to perform fixed pattern noisecompensation. In equation 4, “CP_ori(x,y)” indicates a pixel value ofthe current pixel that is multiplied by the fixed pattern noisecompensation coefficient (gain_intp(k)) of the current pixel, such thatthe fixed pattern noise compensation is completed. Further, the equation4 incorporates a parameter “adjust_rate” to adjust strength of the fixedpattern noise compensation coefficient when encountering variousintensities of different light sources. The pixel value of the currentpixel is multiplied by the compensation coefficient (gain_intp(k)) andan adjustment parameter (adjust_rate) so as to obtain the pixel value(CP(x,y)) that is adjusted and compensated by the fixed pattern noisecompensation coefficient.

CP(x,y)=CP_ori(x,y)×gain_intp×adjust_rate.  Equation 4

When the above step for performing fixed pattern noise compensation foreach of the pixels is completed, it is possible that a stripe patternmay still occur in some regions. It is observed that the stripe patternis determined if an obvious difference between two directions, i.e., upand down or left and right, of the green pixel in the image is found.Therefore, in the method for compensating an image having fixed patternnoise, an aspect of a self-adaptive compensation is applied to the greenpixel (step S413).

For solving the issue of the stripe pattern that is produced due to thedifference between green pixel values in two directions (i.e., up anddown directions or left and right directions), according to theembodiment of the method for compensating an image having fixed patternnoise, it is firstly determined whether or not any stripe pattern is inthe image. References are made to FIG. 7A and FIG. 7B, which areschematic diagrams depicting the pixels in the vertical and horizontaldirections of the current pixel. The method can also be referred to inFIG. 9, which shows a flow chart describing the process forself-adaptive compensation adapted to the green pixel in one embodimentof the disclosure.

For detecting the stripe pattern in the image, referring to FIG. 7A, agreen pixel average of the pixel values of the green pixels P1 _(col),P0 _(col), Q0 _(col) and Q1 _(col) adjacent to the current green pixelin the vertical direction is calculated. The green pixels adjacent tothe current green pixel are such as the other green pixels closest tothe current green pixel. Further, referring to FIG. 7B, another greenpixel average of the pixel values of the green pixels P1 _(row), P0_(row), Q0 _(row) and Q1 _(row) adjacent to the current green pixel inthe horizontal direction is calculated (step S901). FIG. 7A also showsthe schematic diagram of specific positions of a 4-cell in a 4-cellgroup, in which the green pixels of the 4-cell in the grid are shown.For example, “G₀₁” represents the green pixel in row 0 and column 1,“G₂₃” represents the green pixel in row 2 and column 3, and so on.

In FIG. 7A, when the current pixel is the green pixel G₂₂, G₂₃, G₃₂ orG₃₃, the pixel averages P1 _(col), P0 _(col), Q0 _(col) and Q1 _(col) ofthe green pixels in the vertical direction of the current pixel areadopted in the method. The green pixel averages are as indicated inequation 5.

$\begin{matrix}{{{{P\; 1_{col}} = \frac{G_{01} + G_{11} + G_{41} + G_{51}}{4}};}{{{P\; 0_{col}} = \frac{G_{22} + G_{32}}{2}};}{{{Q\; 0_{col}} = \frac{G_{23} + G_{33}}{2}};{and}}{{Q\; 1_{col}} = {\frac{\left( {G_{04} + G_{14} + G_{44} + G_{54}} \right)}{4}.}}} & {{Equation}\mspace{14mu} 5}\end{matrix}$

In FIG. 7B, when the current pixel is still the green pixel G₂₂, G₂₃,G₃₂ or G₃₃, the pixel averages P1 _(row), P0 _(row), Q0 _(row) and Q1_(row) of the green pixels in the horizontal direction of the currentpixel are also adopted in the method. The green pixel averages are asindicated in equation 6.

$\begin{matrix}{{{P\; 1_{row}} = \frac{G_{10} + G_{11} + G_{14} + G_{15}}{4}}{{P\; 0_{row}} = \frac{G_{22} + G_{23}}{2}}{{Q\; 0_{row}} = \frac{G_{32} + G_{33}}{2}}{{Q\; 1_{row}} = \frac{\left( {G_{40} + G_{41} + G_{44} + G_{45}} \right)}{4}}} & {{Equation}\mspace{14mu} 6}\end{matrix}$

After obtaining the vertical and horizontal green pixel averages withrespect to the current green pixel shown in the exemplary examples, thepixel values used for correction in the “up” direction (U), “down”direction (D), “left” direction (L) and “right” direction (R) of thecurrent pixel are calculated (step S903). Further exemplary examples areshown in FIG. 8A and FIG. 8B that are schematic diagrams depicting thepixels used for correcting the stripe pattern.

With the green pixels adjacent to the green pixel in the up, down, leftand right directions as an example, if the current green pixel (G_(cur))is “G₂₂”, the pixel value used for correction in the left column (L)having the green pixels G₁₁ and G₄₁ is calculated as:

$L = \frac{G_{11} + G_{41}}{2}$

The pixel value used for correction in the right column (R) of the greenpixel G₂₂ is G₂₃:

R=G ₂₃

The pixel value used for correction in the upper row (U) having thegreen pixels G₁₁ and G₁₄ of the green pixel G₂₂ is calculated as:

$U = \frac{G_{11} + G_{14}}{2}$

The pixel value used for correction in the lower row (D) of the greenpixel G₂₂ is G₃₂:

D=G ₃₂

If the current green pixel (G_(cur)) is G₂₃, the green pixel used forcorrection in the left column (L) is G₂₂:

L=G ₂₂

The pixel value used for correction in the right column (R) having thegreen pixels G₁₄ and G₄₄ with respect to G₂₃ is calculated as:

$R = \frac{G_{14} + G_{44}}{2}$

The pixel value used for correction in the upper row (U) having thegreen pixels G₁₁ and G₁₄ with respect to G₂₃ is calculated as:

$U = \frac{G_{11} + G_{14}}{2}$

The pixel values used for correction in the lower row (D) of the greenpixel G₂₃ is G₃₂:

D= ₃₂,

If the current green pixel (G_(cur)) is G₃₂, the pixel value of the leftcolumn (L) having the green pixels G₁₁ and G₄₁ with respect to thecurrent green pixel is calculated as:

$L = \frac{G_{11} + G_{41}}{2}$

The pixel value used for correction in the right column (R) of the greenpixel G₃₂ is G₃₃:

R=G ₃₃

The pixel value used for correction in the upper row (U) of the greenpixel G₃₂ is G₂₂:

U=G ₂₂

The pixel value used for correction in the lower row (D) having thegreen pixels G₄₁ and G₄₄ with respect to the green pixel G₃₂ iscalculated as:

$U = \frac{G_{41} + G_{44}}{2}$

Further, when the current green pixel (G_(cur)r) is G₃₃, the green pixelused for correction in the left column (L) is G₃₂:

L=G _(az)

The pixel value used for correction in the right column (R) having thegreen pixels G₁₄ and G₄₄ with respect to the green pixel G₃₃ iscalculated as:

$R = \frac{G_{14} + G_{44}}{2}$

The pixel value used for correction in the upper row (U) of the greenpixel G₃₃ is G₂₃:

U=G ₂₃

The pixel value used for correction in the lower row having the greenpixels G₄₁ and G₄₄ with respect to the green pixel G₃₃ is calculated as:

$D = \frac{G_{41} + G_{44}}{2}$

According to the above exemplary examples, e.g., the equations 5 and 6,the pixel averages (P1 _(col), P0 _(col), Q0 _(col) and Q1 _(col)) ofthe adjacent green pixels in the vertical direction and the pixelaverages (P1 _(row), P0 _(row), Q0 _(row) and Q1 _(row)) of the adjacentgreen pixels in the horizontal direction of the current green pixel(e.g., G₂₂, G₂₃, G₃₂ or G₃₃) are calculated. As shown in FIG. 7A andFIG. 7B, the difference between the pixel averages of the four greenpixels in the vertical direction and in the horizontal direction can beused to detect if there is an edge and check the flatness so as todetermine if the stripe pattern is in the image (step S905).

Three steps to determine the stripe pattern are described as follows. Ina first step, a difference between the vertical pixel averages iscompared with a first column threshold (TH_(COL1)), and a differencebetween the horizontal pixel averages is compared with a first rowthreshold (TH_(ROW1)). The comparison results (FLAG_(COL1), FLAG_(ROW1))can be used to determine whether or not the current green pixel is atthe edge. Equation 7 is used to determine the edges in the vertical andhorizontal directions. An operator “Bool” indicates a Boolean operation.

BooL FLAG_(COL1) =|P1_(col) +P0_(col) −Q0_(col) −Q1_(col) <TH _(COL1)

Bool FLAG_(ROW1) =|P1_(row) +P0_(row) −Q0_(row) −Q1_(row) |<TH_(ROW1)  Equation 7

Next, in a second step, the flatness in the vertical and horizontaldirections near the current green pixel is determined. Referring toequation 8, FIG. 7A and FIG. 7B, a difference between the pixel averagesof the pixels adjacent to the current green pixel in the verticaldirection is compared with a second column threshold (TH_(COL2)), and adifference between the pixel averages of the pixels adjacent to thecurrent green pixel in the horizontal direction is compared with asecond row threshold (TH_(ROW2)). The comparison results (FLAG_(COL2),FLAG_(ROW2)) can be used to determine the flatness near the currentpixel. It is determined to be flat in the image, i.e., flatness, if thedifference between the vertical green pixel averages is smaller than thepredetermined threshold. It is also determined to be flat in the imageif the difference between the horizontal green pixel averages is smallerthan the predetermined threshold.

Bool FLAG_(C0L2) =|P1_(col) −P0_(col) |<TH _(COLZ)

Bool FLAG_(R0W2) =|P1_(row) −P0_(row) |<TH _(R0W2)  Equation 8

Equation 9 indicates the differences of the pixel averages of the pixelsadjacent to the current green pixel in the vertical and horizontaldirections. After the pixel averages of the pixels adjacent to thecurrent green pixel in the vertical and horizontal directions arecompared with a third column threshold (TH_(COL3)) and a third rowthreshold (TH_(ROW3)) respectively, comparison results (FLAG_(COL3),FLAG_(ROW3)) are used to determine the flatness near the current pixel.

Bool FLAG_(COL3) =|Q0_(col) −Q1_(col) |<TH _(COL3)

Bool FLAG_(ROW3) =|Q0_(row) −Q1_(row) |<TH _(ROW3)  Equation 9

The information of flatness (FLAG_(COL1), FLAG_(ROW1), FLAG_(COL2),FLAG_(ROW2), FLAG_(COL3), FLAG_(ROW3)) can be used to determine whetheror not any stripe pattern exists in the vertical and/or horizontaldirections of the current pixel (step S905), as shown in equation 10.

Bool FLAG_(COL)=FLAG_(COL1)&&FLAG_(COL2)&&FLAG_(COL3)

Bool FLAG_(ROW)=FLAG_(ROW1)&&FLAG_(ROW2)&&FLAG_(ROW3)  Equation 10

According to equation 10 in the present disclosure, a compensation valuefor a green pixel is calculated based on several conditions of thestripe patterns in the vertical or/and horizontal direction. Afterwards,the pixel value of the current pixel is compensated through the pixelvalue that is configured to be used for correction, in the up, down,left and right directions of the current pixel (step S907).

Scenario one: in equation 10, when FLAG_(COL) and FLAG_(ROW) are trueand the current pixel is neither a horizontal edge nor a vertical edge,both the horizontal edge and the vertical edge are indicated as havingstripe patterns. At this time, in equation 11, the above green pixelvalues of the up, down, left and right green pixels adjacent to thecurrent green pixel (G_(cur)) are introduced, and the fixed patternnoise compensation coefficient (COEF) is used to correct the currentgreen pixel (G_(cur)). The corrected green pixel can be represented as“Ĝ_(cur).”

Ĝ _(cur) =G _(cur)+(L−G _(cur))×COEF+(R−G _(cur))×COEF+(U−G_(cur))×COEF+(D−G _(eur))×COEF

“L” indicates the pixel value of the left green pixel for correction.“R” indicates the pixel value of the right green pixel for correction.“U” indicates the pixel value of the upper green pixel for correction,and “D” indicates the pixel value of the bottom green pixel forcorrection.

Scenario two: the above determination is false, and when FLAG_(COL) istrue and the current pixel is not at the horizontal edge, the verticaledge is indicated as having stripe patterns. In the meantime, equation12 is introduced to using the pixel values of the pixels in the leftcolumn (L) and right column (R) with respect to the current pixel toobtain the fixed pattern noise compensation coefficient (COEF)calculated by the flow chart shown in FIG. 4 so as to correct thecurrent green pixel. The corrected green pixel can be represented as“Ĝ_(cur).”

Ĝ _(cur) =G _(cur)+(L−G _(cur))×COEF+(R−G _(cur))×COEF  Equation 12

Scenario three: the above two determinations are false, but FLAG_(ROW)is true and the current pixel is not at the vertical edge, indicatingthat the horizontal edge has stripe patterns. In the meantime, equation13 is introduced to using the pixel values of the pixels in the upperrow (U) and lower row (D) with respect to the current pixel to obtainthe fixed pattern noise compensation coefficient (COEF) so as to correctthe current green pixel. The corrected green pixel can be represented as“Ĝ_(cur).”

Ĝ _(cur) =G _(cur)+(U−G _(cur))×COEF+(D−G _(cur))−COEF

Scenario four: the above three determinations are false, indicating thatno stripe pattern is detected.

In summation, according to the above embodiments of the method forcompensating an image having fixed pattern noise and the systemimplementing the method, the method is applied to the system exemplarilyshown in FIG. 10, in which an image is formed from a light received bythe lens 101 and processed by the image sensor 103. The processingcircuit 107 of the system performs the method with respect to the fixedpattern noise in the image. The grid-based compensation method is ableto obtain the compensation coefficients for the divided grids.Accordingly, the image is compensated regionally, and a self-adaptivecompensation can be performed on the green pixel. The method can beperformed in a 4-cell sensor that adopts a 4-cell group and implementsthe image sensor with respect to each of the channels. In the method,the appropriate compensation parameters for the fixed pattern noise canbe calculated automatically based on non-uniformity of the image sensorand the lens.

The foregoing description of the exemplary embodiments of the disclosurehas been presented only for the purposes of illustration and descriptionand is not intended to be exhaustive or to limit the disclosure to theprecise forms disclosed. Many modifications and variations are possiblein light of the above teaching.

The embodiments were chosen and described in order to explain theprinciples of the disclosure and their practical application so as toenable others skilled in the art to utilize the disclosure and variousembodiments and with various modifications as are suited to theparticular use contemplated. Alternative embodiments will becomeapparent to those skilled in the art to which the present disclosurepertains without departing from its spirit and scope.

What is claimed is:
 1. A method for compensating an image having fixedpattern noise, comprising: dividing the image into multiple grids in anarray, wherein each of the grids includes multiple 4-cell groups, eachof the 4-cell groups includes 4 cells, and each cell includes 4 pixels;calculating a channel average that is a pixel average for every channelof each of the grids; calculating a pixel average of pixels in a 4-cellgroup; calculating a fixed pattern noise compensation coefficient forevery pixel of the image according to a ratio of the pixel average ofevery channel in each of the grids and the pixel average of pixels ofevery channel; and performing fixed pattern noise compensation for theimage, wherein the fixed pattern noise compensation coefficient of everypixel is multiplied by a pixel value of every pixel so as to completefixed pattern noise compensation.
 2. The method according to claim 1,wherein the 4 cells of the 4-cell group respectively record red channelvalue (R), blue channel value (B) and green channels (Gr, Gb) valuesgenerated by a 4-cell sensor through a quad Bayer array filter.
 3. Themethod according to claim 2, wherein the 4 cells of the 4-cell groupinclude 16 pixels, in which a position of every pixel is denoted by aposition index and the pixel average for every channel of each of thegrids is an average of a summation of the pixel averages of the pixelswith the same position indexes in each of the grids, so as to form thechannel average.
 4. The method according to claim 3, wherein the channelaverage of each of the grids is denoted by BGridAvg (i,j), RGridAvg(i,j), GbGridAvg (i,j) and GrGridAvg (i,j), and the pixel average of thepixels in the 4-cell group is denoted by localAvg (i,j,k), wherein (i,j)marks a position of each of the grids, k indicates a position of everypixel in the 4-cell group, and k is a position index of 0 to 15, whereinequations to calculate a fixed pattern noise compensation coefficient(gain (i,j,k)) of pixels are:gain (i,j,0)=GrGridAvg (i,j)÷localAvg (i,j,0);gain (i,j,1)=GrGridAvg (i,j)÷localAvg (i,j,1);gain (i,j,2)=RGridAvg (i,j)÷localAvg (i,j,2);gain (i,j,3)=RGridAvg (i,j)÷localAvg (i,j,3);gain (i,j,4)=GrGridAvg (i,j)÷localAvg (i,j,4);gain (i,j,5)=GrGridAvg (i,j)÷localAvg (i,j,5);gain (i,j,6)=RGridAvg (i,j)÷localAvg (i,j,6);gain (i,j,7)=RGridAvg (i,j)÷localAvg (i,j,7);gain (i,j,8)=BGridAvg (i,j)÷localAvg (i,j,8);gain (i,j,9)=BGridAvg (i,j)÷localAvg (i,j,9);gain (i,j,10)=GbGridAvg (i,j)÷localAvg (i,j, 10);gain (i,j,11)=GbGridAvg (i,j)÷localAvg (i,j,11);gain (i,j,12)=BGridAvg (i,j)÷localAvg (i,j,12);gain (i,j,13)=BGridAvg (i,j)÷localAvg (i,j,13);gain (i,j,14)=GbGridAvg (i,j)÷localAvg (i,j,14); andgain (i,j,15)=GbGridAvg (i,j)÷localAvg (i,j,15).
 5. The method accordingto claim 1, wherein the fixed pattern noise compensation for the imageis completed by multiplying the pixel value (CP_ori(x,y)) of a currentpixel by the fixed pattern noise compensation coefficient (gain_intp) ofthe current pixel, and a parameter “adjust_rate” is then introduced toadjust strength of the fixed pattern noise compensation coefficient withrespect to different intensities of different light sources; wherein thepixel value (CP(x,y)) with the fixed pattern noise compensation isobtained by a formula of:CP(x,y)=CP_ori (x,y)×gain_intp×adjust_rate.
 6. The method according toclaim 1, wherein, when the fixed pattern noise compensation iscompleted, further detecting any stripe pattern produced by a differencebetween a pixel value of a current green pixel and green pixel values inthe up and down directions or left and right directions of the currentgreen pixel, and a self-adaptive compensation is performed to: calculatea green pixel average of adjacent green pixels in a vertical directionof the current green pixel and another green pixel average of adjacentgreen pixels in the horizontal direction of the current green pixel;calculate a pixel value used for correction in the up, down, left andright directions of the current green pixel; detect an edge and flatnessnear the current green pixel according to a difference of pixel averagesbetween four horizontal directions and four vertical directions adjacentto the current green pixel so as to determine if any stripe pattern isin the vertical and horizontal directions in the image; and according tothe determined stripe pattern, use the pixel values in the up, down,left and right directions of the current pixel to compensate the pixelvalue of the current green pixel.
 7. The method according to claim 1,wherein extrapolation is used to optimize the fixed pattern noisecompensation coefficient of the pixel at an edge of the image, in whichone row and one column are added at the edge of the image that includesmultiple grids in the array, and the extrapolation is used to obtain thefixed pattern noise compensation coefficient of the pixel at the edge.8. The method according to claim 7, wherein equations for calculatingthe fixed pattern noise compensation coefficient of the pixel at theedge by the extrapolation are:upper edge: gain(0,j,k)=2×gain(1,j,k)−gain(2,j,k), wherein 1≤j≤n;lower edge: gain(m+1,j,k)=2×gain(m,j,k)−gain(m−1,j,k), wherein 1≤j≤n;left edge: gain(i,0,k)=2×gain(i,1,k)−gain(i,2,k), wherein 1≤i≤m;right edge: gain(i,n+1,k)=2×gain(i,n,k)−gain(i,n−1,k), wherein 1≤i≤m;upper left: gain(0,0,k)=2×gain(1,1,k)−gain(2,2,k);upper right: gain(0,n+1,k)=2×gain(1,n,k)−gain(2,n−1,k);bottom left: gain(m+1,0,k)=2×gain(m,1,k)−gain(m−1,2,k); andbottom right: gain(m+1,n+1,k)=2×gain(m,n,k)−gain(m−1,n−1,k); wherein “m”is a height of an original grid of the image, “n” is a width of theoriginal grid of the image, “gain(i,j,k)” is the fixed pattern noisecompensation coefficient of the pixel of the image, “(i,j)” is used todescribe a position of the grid after the row and column are added, and“k” is a position index of the pixel.
 9. The method according to claim1, wherein interpolation is further used to obtain the fixed patternnoise compensation coefficient of a current pixel, in which multiplegrids adjacent to the current pixel are determined, and distancesbetween the current pixel and center points of the multiple grids arecalculated, and the interpolation is performed according to thedistances so as to obtain the fixed pattern noise compensationcoefficient of the current pixel.
 10. The method according to claim 9,wherein a vertical distance between the current pixel and upper-left andupper-right grids is D1, a vertical distance between the current pixeland bottom-left and bottom-right grids is D2, a horizontal distancebetween the current pixel and upper-left and bottom-left grids is D3,and a horizontal distance between the current pixel and upper-right andbottom-right is D4, wherein equations of the interpolation are:gain_intp(k)=(D2/(D1+D2))×(D4/(D3+D4))×gain(i1,j1,k)+(D2/(D1+D2))×(D3/(D3+D4))×gain(i2,j2,k)+(D1/(D1+D2))×(D4/(D3+D4))×gain(i3,j3,k)+(D1/(D1+D2))×(D3/(D3+D4))×gain(i4,j4,k); wherein “gain_intp(k)” isthe fixed pattern noise compensation coefficient for the current pixelobtained by the interpolation, and “gain(i1 j1,k), gain(i2,j2,k),gain(i3,j3,k) and gain(i4,j4,k)” are the fixed pattern noisecompensation coefficients for the central pixels of the grids adjacentto the current pixel.
 11. A system, comprising: an image sensor; and aprocessing circuit, which performs a method for compensating an imagehaving fixed pattern noise when receiving an image, the methodcomprising: dividing an image into multiple grids in an array, whereineach of the grids includes multiple 4-cell groups, each of the 4-cellgroups includes 4 cells, and each cell includes 4 pixels; calculating achannel average that is a pixel average for every channel of each of thegrids; calculating a pixel average of pixels in a 4-cell group;calculating a fixed pattern noise compensation coefficient for everypixel of the image according to a ratio of the pixel average of everychannel in each of the grids and the pixel average of pixels of everychannel; and performing fixed pattern noise compensation for the image,wherein the fixed pattern noise compensation coefficient of every pixelis multiplied by a pixel value of every pixel so as to complete fixedpattern noise compensation.
 12. The system according to claim 11,wherein the image sensor is a 4-cell sensor, and the 4 cells of the4-cell group in the image respectively record red channel value (R),blue channel value (B) and green channel values (Gr, Gb) generated by a4-cell sensor through a quad Bayer array filter.
 13. The systemaccording to claim 12, wherein the 4 cells of the 4-cell group include16 pixels, in which a position of every pixel is denoted by a positionindex and the pixel average for every channel of each of the grids is anaverage of a summation of the pixel averages of the pixels with the sameposition indexes in each of the grids, so as to form the channelaverage.
 14. The system according to claim 13, wherein, in the methodfor compensating an image having fixed pattern noise, the channelaverage of each of the grids is denoted by: BGridAvg (i,j), RGridAvg(i,j), GbGridAvg (i,j) and GrGridAvg (i,j) and the pixel average of thepixels in the 4-cell group is denoted by localAvg (i,j,k), wherein (i,j)marks position of each of the grids, k indicates position of every pixelin the 4-cell group, and k is position index of 0 to 15; whereinequations to calculate fixed pattern noise compensation coefficient(gain (i,j,k)) of pixels are:Gain (i,j,0)=GrGridAvg (i,j)÷localAvg (i,j,0);gain (i,j,1)=GrGridAvg (i,j)÷localAvg (i,j,1);gain (i,j,2)=RGridAvg (i,j)÷localAvg (i,j,2);Gain (i,j,3)=RGridAvg (i,j)÷localAvg (i,j,3);gain (i,j,4)=GrGridAvg (i,j)÷localAvg (i,j,4);gain (i,j,5)=GrGridAvg (i,j)÷localAvg (i,j,5);gain (i,j,6)=RGridAvg (i,j)÷localAvg (i,j,6);gain (i,j,7)=RGridAvg (i,j)÷localAvg (i,j,7);gain (i,j,8)=BGridAvg (i,j)÷localAvg (i,j,8);gain (i,j,9)=BGridAvg (i,j)÷localAvg (i,j,9);gain (i,j,10)=GbGridAvg (i,j)÷localAvg (i,j,10);gain (i,j,11)=GbGridAvg (i,j)÷localAvg (i j,11);gain (i,j,12)=BGridAvg (i,j)÷localAvg (i,j,12);gain (i,j,13)=BGridAvg (i,j)÷localAvg (i,j,13);gain (i,j,14)=GbGridAvg (i,j)÷localAvg (i,j,14); andgain (i,j,15)=GbGridAvg (i,j)÷localAvg (i,j,15).
 15. The systemaccording to claim 11, wherein the fixed pattern noise compensation forthe image is completed by multiplying the pixel value (CP_ori(x,y)) of acurrent pixel by the fixed pattern noise compensation coefficient(gain_intp) of the current pixel, and a parameter “adjust_rate” is thenintroduced to adjust strength of the fixed pattern noise compensationcoefficient with respect to different intensities of different lightsources; wherein the pixel value (CP(x,y)) with the fixed pattern noisecompensation is obtained by a formula of:CP(x,y)=CP_ori(x,y)×gain_intp×adjust_rate.
 16. The system according toclaim 11, wherein, in the method for compensating an image having fixedpattern noise, when the fixed pattern noise compensation is completed,further detecting any stripe pattern produced by a difference between apixel value of a current green pixel and green pixel values in the upand down directions or left and right directions of the current greenpixel, and a self-adaptive compensation is performed to: calculate agreen pixel average of adjacent green pixels in a vertical direction ofthe current green pixel and another green pixel average of adjacentgreen pixels in the horizontal direction of the current green pixel;calculate a pixel value used for correction in the up, down, left andright directions of the current green pixel; detect an edge and flatnessnear the current green pixel according to a difference of pixel averagesbetween four horizontal directions and four vertical directions adjacentto the current green pixel so as to determine if any stripe pattern isin the vertical and horizontal directions in the image; and according tothe determined stripe pattern, use the pixel values in the up, down,left and right directions of the current pixel to compensate the pixelvalue of the current green pixel.
 17. The system according to claim 11,wherein, in the method for compensating an image having fixed patternnoise, extrapolation is used to optimize the fixed pattern noisecompensation coefficient of the pixel at an edge of the image; in whichone row and one column are added at the edge of the image that includesmultiple grids in the array; and the extrapolation is used to obtain thefixed pattern noise compensation coefficient of the pixel at the edge.18. The system according to claim 17, wherein equations for calculatingthe fixed pattern noise compensation coefficient of the pixel at theedge by the extrapolation are:upper edge: gain(0,j,k)=2×gain(1,j,k)−gain(2,j,k), wherein 1≤j≤n;lower edge: gain(m+1,j,k)=2×gain(m,j,k)−gain(m−1,j,k), wherein 1≤j≤n;left edge: gain(i,0,k)=2×gain(i,1,k)−gain(i,2,k), wherein 1≤i≤m;right edge: gain(i,n+1,k)=2×gain(i,n,k)−gain(i,n−1,k), wherein 1≤i≤m;upper left: gain(0,0,k)=2×gain(1,1,k)−gain(2,2,k);upper right: gain(0,n+1,k)=2×gain(1,n,k)−gain(2,n−1,k);bottom left: gain(m+1,0,k)=2×gain(m,1,k)−gain(m−1,2,k); andbottom right: gain(m+1,n+1,k)=2×gain(m,n,k)−gain(m−1,n−1,k); wherein,“m” is a height of an original grid of the image, “n” is a width of theoriginal grid of the image, “gain (i,j,k)” is the fixed pattern noisecompensation coefficient of the pixel of the image, “(i,j)” is used todescribe a position of the grid after the row and column are added, and“k” is a position index of the pixel.
 19. The system according to claim11, wherein, in the method for compensating an image having fixedpattern noise, interpolation is further used to obtain the fixed patternnoise compensation coefficient of a current pixel, in which multiplegrids adjacent to the current pixel are determined, and distancesbetween the current pixel and center points of the multiple grids arecalculated, and the interpolation is performed according to thedistances so as to obtain the fixed pattern noise compensationcoefficient of the current pixel.
 20. The system according to claim 19,wherein a vertical distance between the current pixel and upper-left andupper-right grids is D1, a vertical distance between the current pixeland bottom-left and bottom-right grids is D2, a horizontal distancebetween the current pixel and upper-left and bottom-left grids is D3,and a horizontal distance between the current pixel and upper-right andbottom-right is D4, wherein equations of the interpolation are:gain_intp(k)=(D2/(D1+D2))−(D4/(D3+D4))×gain(i1,j1,k)+(D2/(D1+D2))×(D3/(D3+D4))×gain(i2,j2,k)+(D1/(D1+D2))×(D4/(D3+D4))×gain(i3,j3,k)+(D1/(D1+D2))×(D3/(D3+D4))×gain(i4,j4,k);wherein, “gain_intp(k)” is the fixed pattern noise compensationcoefficient for the current pixel obtained by the interpolation, and“gain(i1,j1,k), gain(i2,j2,k), gain(i3,j3,k) and gain(i4,j4,k)” are thefixed pattern noise compensation coefficients for the central pixels ofthe grids adjacent to the current pixel.